home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 33 / Amiga Format AFCD33 (Issue 117, Dec 1998).iso / -seriously_amiga- / graphics / splitmpegwos / src / global.c < prev    next >
C/C++ Source or Header  |  1998-09-07  |  3KB  |  86 lines

  1. /*
  2.  * Copyright (c) 1994 Michael Simmons.
  3.  * All rights reserved.
  4.  * 
  5.  * Permission to use, copy, modify, and distribute this software and its
  6.  * documentation for any purpose, without fee, and without written agreement is
  7.  * hereby granted, provided that the above copyright notice and the following
  8.  * two paragraphs appear in all copies of this software.
  9.  * 
  10.  * IN NO EVENT SHALL MICHAEL SIMMONS BE LIABLE TO ANY PARTY FOR
  11.  * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
  12.  * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF MICHAEL SIMMONS
  13.  * HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  14.  * 
  15.  * THE MICHAEL SIMMONS SPECIFICALLY DISCLAIMS ANY WARRANTIES,
  16.  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
  17.  * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
  18.  * ON AN "AS IS" BASIS, AND MICHAEL SIMMONS HAS NO OBLIGATION TO
  19.  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  20.  *
  21.  * I can be contacted via 
  22.  * Email: michael@ecel.uwa.edu.au
  23.  * Post: P.O. Box 506, NEDLANDS WA 6009, AUSTRALIA
  24.  *
  25.  * Amigaversion by Tobias Seiler in 1997
  26.  * Email: tabs@blader.com
  27.  */
  28.  
  29. #include "main.h"
  30.  
  31. jmp_buf env;
  32. int quiet_flag;
  33. int verbose_flag;
  34. int system_header_found;
  35. int pack_cnt;
  36. int packet_cnt;
  37. int system_header_cnt;
  38.  
  39. FILE *BitStream;
  40. int EOF_flag;
  41. unsigned int curBits;
  42. int bitOffset;
  43. int bufLength;
  44. int max_buf_length;
  45. unsigned int *bitBuffer;
  46. unsigned int *buf_start;
  47.  
  48. StreamInfo      streamInfo[MAX_NUM_STREAMS];
  49.  
  50. unsigned int nBitMask[] = { 0x00000000, 0x80000000, 0xc0000000, 0xe0000000, 
  51.                 0xf0000000, 0xf8000000, 0xfc000000, 0xfe000000, 
  52.                 0xff000000, 0xff800000, 0xffc00000, 0xffe00000, 
  53.                 0xfff00000, 0xfff80000, 0xfffc0000, 0xfffe0000, 
  54.                 0xffff0000, 0xffff8000, 0xffffc000, 0xffffe000, 
  55.                 0xfffff000, 0xfffff800, 0xfffffc00, 0xfffffe00, 
  56.                 0xffffff00, 0xffffff80, 0xffffffc0, 0xffffffe0, 
  57.                 0xfffffff0, 0xfffffff8, 0xfffffffc, 0xfffffffe};
  58.  
  59. unsigned int bitMask[] = {  0xffffffff, 0x7fffffff, 0x3fffffff, 0x1fffffff, 
  60.                 0x0fffffff, 0x07ffffff, 0x03ffffff, 0x01ffffff,
  61.                 0x00ffffff, 0x007fffff, 0x003fffff, 0x001fffff,
  62.                 0x000fffff, 0x0007ffff, 0x0003ffff, 0x0001ffff,
  63.                 0x0000ffff, 0x00007fff, 0x00003fff, 0x00001fff,
  64.                 0x00000fff, 0x000007ff, 0x000003ff, 0x000001ff,
  65.                 0x000000ff, 0x0000007f, 0x0000003f, 0x0000001f,
  66.                 0x0000000f, 0x00000007, 0x00000003, 0x00000001};
  67.  
  68. unsigned int rBitMask[] = { 0xffffffff, 0xfffffffe, 0xfffffffc, 0xfffffff8, 
  69.                 0xfffffff0, 0xffffffe0, 0xffffffc0, 0xffffff80, 
  70.                 0xffffff00, 0xfffffe00, 0xfffffc00, 0xfffff800, 
  71.                 0xfffff000, 0xffffe000, 0xffffc000, 0xffff8000, 
  72.                 0xffff0000, 0xfffe0000, 0xfffc0000, 0xfff80000, 
  73.                 0xfff00000, 0xffe00000, 0xffc00000, 0xff800000, 
  74.                 0xff000000, 0xfe000000, 0xfc000000, 0xf8000000, 
  75.                 0xf0000000, 0xe0000000, 0xc0000000, 0x80000000};
  76.  
  77. unsigned int bitTest[] = {  0x80000000, 0x40000000, 0x20000000, 0x10000000, 
  78.                 0x08000000, 0x04000000, 0x02000000, 0x01000000,
  79.                 0x00800000, 0x00400000, 0x00200000, 0x00100000,
  80.                 0x00080000, 0x00040000, 0x00020000, 0x00010000,
  81.                 0x00008000, 0x00004000, 0x00002000, 0x00001000,
  82.                 0x00000800, 0x00000400, 0x00000200, 0x00000100,
  83.                 0x00000080, 0x00000040, 0x00000020, 0x00000010,
  84.                 0x00000008, 0x00000004, 0x00000002, 0x00000001};
  85.  
  86.